import QtQuick 2.0
import org.qtproject.qtquick 1.0

import "qrc:/js/resources/Constants.js" as Constant

import "../delegate"
import "../common"
import "../configure"
import "../group"

MainFooterPage {
    id: id_friendListPage

    width: Constant.width * m_ratio
    height: Constant.height * m_ratio

    property real m_ratio : ApplicationInfo.ratio
    property int m_heightItem : 120 * m_ratio;
    property var uid;

    m_footer.title: "Group..."
    m_footer.imageIcon: "qrc:/images/resources/icon_add_chat_group.png"
    m_footer.onSearchClicked: {
        id_pageView.push(Qt.resolvedUrl("../group/CreateGroupPage.qml"));
        console.log("Make group");
    }

    Item {
        id: id_friendListItem

        width: parent.width
        height: parent.height - m_footer.height

        anchors.bottom: m_footer.top;

        anchors.topMargin: 5;


        ListView {
            id: id_friendList
            width: parent.width
            height: parent.height
            visible: true
            //spacing: 8

            delegate: FriendListDelegate {
                m_uid: uid
            }

            model: ApplicationInfo.friendListModel

        }

        ScrollBar {
            scrollArea: id_friendList;
            height: id_friendList.height;
            width: 8 * m_ratio
            anchors.right: id_friendList.right
        }
    }
}
